package br.com.absolutech.study.chapter6.pag253;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Main {

	public static void main(String[] args) {

		try {

			File existingDir = new File("existingDir");
			System.out.println(existingDir.isDirectory());
			File existingDirFile = new File(existingDir, "existingDirFile.txt");
			System.out.println(existingDirFile.isFile());

			FileReader fr;
			fr = new FileReader(existingDirFile);
			BufferedReader br = new BufferedReader(fr);

			String s;
			while ((s = br.readLine()) != null) {
				System.out.println(s);
			}
			br.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
